package base;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by LiJZ on 2016/7/28.
 */
public abstract class BaseUtilActivity extends AppCompatActivity {
	public static BaseUtilActivity ForegroundActivity = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(setLayoutID());
		init();
		initView();
		initEvent();
		initActionBar();
	}

	@Override
	protected void onResume() {
		super.onResume();
		this.ForegroundActivity = this;
	}

	public static BaseUtilActivity getForegroundActivity(){
		return ForegroundActivity;
	}

	protected abstract int setLayoutID();

	protected abstract void init();

	protected abstract void initActionBar();

	protected abstract void initView();

	protected abstract void initEvent();
}
